# Copyright (C) 2023 - 2024 Advanced Micro Devices, Inc.  All rights reserved.
# SPDX-License-Identifier: MIT
cmake_minimum_required(VERSION 3.15)
project(rfdc)

find_package(common)
add_definitions(-D__BAREMETAL__)
add_definitions(-DXLNX_PLATFORM)
collector_create (PROJECT_LIB_HEADERS "${CMAKE_CURRENT_SOURCE_DIR}")
collector_create (PROJECT_LIB_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}")
include_directories(${CMAKE_BINARY_DIR}/include)
collect (PROJECT_LIB_SOURCES xrfdc.c)
collect (PROJECT_LIB_SOURCES xrfdc_ap.c)
collect (PROJECT_LIB_SOURCES xrfdc_clock.c)
collect (PROJECT_LIB_SOURCES xrfdc_dp.c)
collect (PROJECT_LIB_SOURCES xrfdc_g.c)
collect (PROJECT_LIB_SOURCES xrfdc_intr.c)
collect (PROJECT_LIB_SOURCES xrfdc_mb.c)
collect (PROJECT_LIB_SOURCES xrfdc_mixer.c)
collect (PROJECT_LIB_SOURCES xrfdc_mts.c)
collect (PROJECT_LIB_SOURCES xrfdc_sinit.c)
collect (PROJECT_LIB_HEADERS xrfdc.h)
collect (PROJECT_LIB_HEADERS xrfdc_hw.h)
collector_list (_sources PROJECT_LIB_SOURCES)
collector_list (_headers PROJECT_LIB_HEADERS)
file(COPY ${_headers} DESTINATION ${CMAKE_BINARY_DIR}/include)
add_library(rfdc STATIC ${_sources})
set_target_properties(rfdc PROPERTIES LINKER_LANGUAGE C)
